import { FC } from "react"

//引入自定义hook

import useCounter from "../自定义hook/useCounter"

let UseCustomHook: FC<any> = () => {
    let [count, method] = useCounter(100)
    return (
        <fieldset>
            <legend>使用自定义hook</legend>
            <button onClick={() => {
                method.increase(10)
            }}>+</button>
            --
            <b>{count}</b>
            --
            <button onClick={() => {
                method.decrease(5)
            }}>-</button>
        </fieldset>
    )
}

export default UseCustomHook